<template>
	<view class="container" :style="[containHeight]">
		<view class="menu_content"><!-- v-if="roleId!='general_user'" -->
			<view class="TitleTxt" v-if="authDegree!='3'">				
				<text>培训题库管理</text>				
			</view>
			<u-row class="subMenu_content" v-if="authDegree!='3'"><!-- roleId!='general_user' -->
				<u-col span="4" v-if="authDegree!='2'"><!-- roleId!='general_admin' -->
					<view class="menu_item layout-column-center" @click="toSubMenu(1)">
						<image src="../../static/ku.png" mode="scaleToFill" class="MenuImage"></image>
						<text>基础试题库</text>
					</view>
				</u-col>
				<u-col :span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(12)">
						<image src="../../static/calfi.png" mode="scaleToFill" class="MenuImage"></image>
						<text>试题库分类</text>
					</view>
				</u-col>
				<u-col :span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(13)">
						<image src="../../static/crowd.png" mode="scaleToFill" class="MenuImage"></image>
						<text>培训人群管理</text>
					</view>
				</u-col>
				<u-col span="4" v-if="authDegree=='2'"><!-- roleId=='general_admin' -->
					<view class="menu_item layout-column-center" @click="toSubMenu(14)">
						<image src="../../static/juan.png" mode="scaleToFill" class="MenuImage"></image>
						<text>基础培训试卷</text>
					</view>
				</u-col>
			</u-row>
			<u-row class="subMenu_content" v-if="authDegree!='3'"><!-- roleId!='general_user' -->
				<u-col span="4" v-if="authDegree!='2'"><!-- roleId!='general_admin' -->
					<view class="menu_item layout-column-center" @click="toSubMenu(14)">
						<image src="../../static/juan.png" mode="scaleToFill" class="MenuImage"></image>
						<text>基础培训试卷</text>
					</view>
				</u-col>
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(15)">
						<image src="../../static/quizz.png" mode="scaleToFill" class="MenuImage"></image>
						<text>竞赛答题试卷</text>
					</view>
				</u-col>
			</u-row>			
			<view class="TitleTxt" v-if="authDegree=='3'">
				<text>在线考试</text>
			</view>	
			<view class="TitleTxt mt80" v-else>
				<text>在线考试</text>
			</view>
			<u-row class="subMenu_content">
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(21)">
						<image src="../../static/online_img.png" mode="scaleToFill" class="MenuImage"></image>
						<text>在线考试</text>
					</view>
				</u-col>
			</u-row>
			<view class="TitleTxt mt80">
				<text>培训结果查询</text>
			</view>
			<u-row class="subMenu_content">
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(31)">
						<image src="../../static/onlineResult.png" mode="scaleToFill" class="MenuImage"></image>
						<text>基础成绩查询</text>
					</view>
				</u-col>
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(32)">
						<image src="../../static/quizResult.png" mode="scaleToFill" class="MenuImage"></image>
						<text>竞赛成绩查询</text>
					</view>
				</u-col>
				<u-col span="4">				
					<view class="menu_item layout-column-center" @click="toSubMenu(33)">
						<image src="../../static/creditResult.png" mode="scaleToFill" class="MenuImage"></image>
						<text>学分/学时查询</text>
					</view>
				</u-col>
			</u-row>
			<u-row class="subMenu_content">
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(34)">
						<image src="../../static/collectBlue.png" mode="scaleToFill" class="MenuImage"></image>
						<text>我的收藏</text>
					</view>
				</u-col>
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(35)">
						<image src="../../static/mistakesCollection.png" mode="scaleToFill" class="MenuImage"></image>
						<text>我的错题集</text>
					</view>
				</u-col>
			</u-row>
			<!-- v-if="roleId!='general_user'" -->
			<view class="TitleTxt mt80">
				<text>数据统计分析</text>
			</view>
			<!-- v-if="roleId!='general_user'" -->
			<u-row class="subMenu_content">
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(41)">
						<image src="../../static/juStatic.png" mode="scaleToFill" class="MenuImage"></image>
						<text>数据统计分析</text>
					</view>
				</u-col>
			</u-row>
			<view class="TitleTxt mt80">
				<text>学习资料</text>
			</view>
			<u-row class="subMenu_content">
				<!-- <u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(51)">
						<image src="../../static/txt.png" mode="scaleToFill" class="MenuImage"></image>
						<text>文本学习</text>
					</view>
				</u-col> -->
				<!-- <u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(52)">
						<image src="../../static/video.png" mode="scaleToFill" class="MenuImage"></image>
						<text>视频学习</text>
					</view>
				</u-col> -->
				<u-col span="4">
					<view class="menu_item layout-column-center" @click="toSubMenu(53)">
						<image src="../../static/txtManger.png" mode="scaleToFill" class="MenuImage"></image>
						<text>资料管理</text>
					</view>
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fullHeight: true,
				roleId:'',
				authDegree:'',
			}
		},
		onLoad() {
			this.roleId=uni.getStorageSync('userinfo').roleId
			this.authDegree= uni.getStorageSync('userinfo').authDegree
		},
		computed: {
			containHeight() {
				return {
					/*#ifdef MP-WEIXIN*/
					// 微信小程序特有代码
					height: this.fullHeight ? '100vh' : 'auto',
					/*#endif*/
					/*#ifndef MP-WEIXIN*/
					height: this.fullHeight ? 'calc(100vh - 44px - 50px)' : 'auto',
					/*#endif*/
					transition: 'all 1s ease'
				}
			}
		},
		onReachBottom() {
			if (this.fullHeight) {
				this.fullHeight = false
			}
		},
		methods: {
			toSubMenu(index) {
				console.log("index", index);
				if (index == 1) {
					uni.navigateTo({
						url: '/pages/bank/bankBasics'
					})
				} else if (index == 12) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/testBank'
					})
				} else if (index == 13) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/crowdManagement'
					})
				} else if (index == 14) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/basicTrainingExam'
					})
				} else if (index == 15) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/challengeList'
					})
				} else if (index == 21) {
					uni.navigateTo({
						url: '/pages/onlineTesting/multipleChoice'
					})
				} else if (index == 31) {
					uni.navigateTo({
						url: '/pages/mine/mine'
					})
				} else if (index == 32) {
					uni.navigateTo({
						url: '/pages/quizCompetition/quizCompetition'
					})
				} else if (index == 33) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/creditHourInquiry'
					})
				} else if (index == 34) {
					uni.navigateTo({
						url: '/pages/mine/collection'
					})
				} else if (index == 35) {
					uni.navigateTo({
						url: '/pages/mine/mistakesCollection'
					})
				} else if (index == 41) {
					uni.navigateTo({
						url: '/pages/dataAnalyse/analyseQuestion'
					})
				} else if (index == 53) {
					uni.navigateTo({
						url: '/pages/intensiveTraining/dataManagement'
					})
				} else {

				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		background: linear-gradient(#BDD7FE 15%, #F6FAFF 100%);
		padding: 20rpx 40rpx;
		width: 100%;
		position: relative;
		box-sizing: border-box;
	}

	.TitleTxt {
		font-size: 35rpx;
		color: #333333;
		font-weight: bold;
	}

	.menu_content {
		box-sizing: border-box;
		padding: 20rpx 15rpx;
		width: 100%;
		position: relative;
		background: #ffffff;
		margin-top: 20rpx;
		border-radius: 30rpx;
		box-shadow: 5rpx 0rpx 6rpx 5rpx #fff;
		
	}
	.subMenu_content {
		box-sizing: border-box;
		padding: 20rpx 0rpx;
		width: 100%;
		overflow-wrap: break-word;		
	}
	.menu_item {
		width: 100%;
		margin-top: 10rpx;
		font-size: 30rpx;
		box-sizing: border-box;
		padding: 10rpx 20rpx;
		white-space: nowrap;				
	}
	.MenuImage {
		display: block;
		width: 80rpx;
		height: 80rpx;
		margin-bottom: 20rpx;
	}
	.mt80{
		margin-top: 80rpx;
	}
</style>